/*
 *	wfx.h
 *	Fundmental header of the WolvGen
 *	Also include in boost libraries
 *	@author Wolfhead <wolfhead87@gmail.com>
 *	@date 2010-4-9
 */


#pragma once

#ifndef _WFX_H_
#define _WFX_H_


#include <assert.h>
#ifndef WFX_ASSERT
#define WFX_ASSERT(expr) assert(expr)
#endif // #ifndef ASSERT

// Anonymous variable declaration 
#define ___ANONYMOUS(type,var,line) type var##line
#define __ANONYMOUS(type,line) ___ANONYMOUS(type,_anonymous,line)
#define ANONYMOUS(type) __ANONYMOUS(type,__LINE__)

// _CAnonymous_ class used in STATIC_EVAL
class _CAnonymous_
{
public:
    template <class T>
    _CAnonymous_(T eval){};
};

// STATIC_EVAL
#ifndef STATIC_EVAL
#define STATIC_EVAL(eval) \
    ANONYMOUS(static _CAnonymous_)(eval);
#endif // #ifndef STATIC_EVAL



/************************************************************************/
/*  Boost                                                               */
/************************************************************************/

// boost smart pointer support
#include <boost/shared_ptr.hpp>
#include <boost/pointer_cast.hpp>

#ifndef MAKE_PTR
#define MAKE_PTR(T) \
    class T;\
    typedef boost::shared_ptr<T> T##Ptr;\
    typedef boost::shared_ptr<const T> T##ConstPtr;\
    typedef boost::shared_ptr<T>& T##PtrRef;\

#endif // #ifndef MAKE_PTR

// boost exception support
#pragma warning(disable : 4996)
#include <boost/exception/all.hpp>


/************************************************************************/
/* Inner utility                                                        */
/************************************************************************/

// Log function
#include "Log/Log.h"

// Error handle
#include "Error/ErrorHandle.h"

#endif // #ifndef _WFX_H_

